package me.ereach.set;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;

public class MainCollection {
    public static void main(String[] args) {
        Collection<String> collection = new ArrayList<>();

        Collections.addAll(collection, "abc", "bcd", "cde");
        System.out.println(collection);
        System.out.println(collection.size());

        Object[] arr1 = collection.toArray();
        System.out.println(arr1[0]);

        var arr2 = collection.toArray(new String[0]);
        System.out.println(arr2);
        for (var x : arr2)
            System.out.println(x);
    }
}
